import type {ISearchConfig} from "@/components/PageSearch/index.vue";

const searchConfig = (params?: any): ISearchConfig => {
    return {
        pageName: "batchImportExportConfig",
        formItems: [
            {
                type: "select",
                label: "表名",
                prop: "tableName",
                attrs: {
                    filterable: true,
                    placeholder: "请选择表名",
                    clearable: true,
                    style: {
                        width: "200px",
                    },
                },
                async initFn(formItem) {
                    this.options = await params?.getAllTableInfo();
                },
            },
            {
                type: "select",
                label: "模板类型",
                prop: "type",
                options: [
                    {label: "导入", value: "0"},
                    {label: "导出", value: "1"},
                ],
                attrs: {
                    placeholder: "请选择模板类型",
                    clearable: true,
                    style: {
                        width: "200px",
                    },
                },
            },
            {
                type: "input",
                label: "备注",
                prop: "remark",
                attrs: {
                    placeholder: "请输入备注",
                    clearable: true,
                    style: {
                        width: "200px",
                    },
                },
            },
            // {
            //     type: "select",
            //     label: "字段映射状态",
            //     prop: "status",
            //     options: [
            //         {label: "待初始化", value: "0"},
            //         {label: "已初始化", value: "1"}
            //     ],
            //     attrs: {
            //         placeholder: "请选择状态",
            //         clearable: true,
            //         style: {
            //             width: "200px",
            //         },
            //     },
            // },
        ],
    }
};

export default searchConfig;
